package n08.second;

import java.util.Arrays;
import java.util.Comparator;

public class N03 {

	public static void main(String[] args) {
		Student[]a= {
				new Student("20240108", "张三", 21, 1.75),
				new Student("20240105", "李四", 19, 1.95),
				new Student("20240101", "王五", 20, 1.85),
		};
		System.out.println("按年龄的升序排列Student数组：");
		Arrays.sort(a, (s1,s2)->s1.getAge()-s2.getAge());
		for (Student student : a) {
			System.out.println(student);
		}

	}

}
